package com.qidian.mes.sys.controller;

import com.qidian.mes.sys.service.FileUploadService;
import com.qidian.mes.util.pojo.QdResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author 小可怎么都睡不够
 * @Company 起点编程
 * @Description
 * @Time 2024/4/11 11:10
 */
@RestController
@CrossOrigin
@RequestMapping("/upload")
public class FileUploadController {
    @Autowired
    private FileUploadService fileUploadService;
    @RequestMapping("/image")
    public QdResult uploadImage(@RequestParam("file") MultipartFile file) {
        return fileUploadService.uploadFile(file);
    }
}
